package io.jnet.server.accepthandler.impl;

import java.nio.channels.AsynchronousServerSocketChannel;
import java.nio.channels.AsynchronousSocketChannel;
import io.jnet.common.api.ChannelContext;
import io.jnet.common.util.AioListener;
import io.jnet.server.build.ServerChannelContextBuilder;
import io.jnet.server.build.ServerChannelContextConfig;
import io.jnet.server.serverchannelcontext.SimpleServerChannelContext;

public class SimpleAcceptHandler extends AbstractAcceptHandler
{
    public SimpleAcceptHandler(AsynchronousServerSocketChannel serverSocketChannel, ServerChannelContextBuilder channelContextBuilder, AioListener serverListener)
    {
        super(serverSocketChannel, channelContextBuilder, serverListener);
    }
    
    @Override
    protected ChannelContext parse(AsynchronousSocketChannel socketChannel, ServerChannelContextConfig config, AioListener listener)
    {
        ChannelContext serverChannelContext = new SimpleServerChannelContext(//
                config.getBufStorage(), //
                config.getMaxMerge(), //
                listener, //
                config.getProcessors(), //
                socketChannel, //
                config.getFrameDecodec());
        return serverChannelContext;
    }
    
    @Override
    public void stop()
    {
        ;
    }
    
}
